<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!-- 分页 -->
<c:set var="pre_disabled" value=""></c:set>
<c:if test="${pageModel.pageNo le 1}">
    <c:set var="pre_disabled" value="disabled"></c:set>
</c:if>
<c:set var="next_disabled" value=""></c:set>
<c:if test="${pageModel.pageNo ge pageModel.pageTotal}">
    <c:set var="next_disabled" value="disabled"></c:set>
</c:if>
    <div class="ss-pagination">
        <span class="ui-text-box"> 每页 ${pageModel.pageSize } 条 共  <b>${pageModel.totalRecord } </b> 条</span>
        <span class="ui-text-box"> 当前第 ${pageModel.pageNo } 页 共 ${pageModel.pageTotal } 页</span>
        <ul class="pagination">
            <li class="previous ${pre_disabled }" tabindex="0"><a href="javascript:topage(${pageModel.pageNo-1 }, ${pageModel.pageTotal })">上一页</a></li>
            <!-- index为序号，显示index最大值个页码数， 当前轮询到第index个页码，当前序号不超过总页数且当前页码不超过总页数且当前页码加序号不超过总页数-->
            <c:forEach items="${pageModel.pageNoList }" var="pageIndex">
                <c:if test="${(pageIndex gt 0) and (pageModel.pageNo le pageModel.pageTotal) and (pageIndex le pageModel.pageTotal)}">
                    <c:choose> <c:when test="${pageIndex eq pageModel.pageNo}"> <c:set value="active" var="page_active" scope="page"></c:set> </c:when>
                        <c:otherwise> <c:set value="" var="page_active" scope="page"></c:set> </c:otherwise>
                    </c:choose>
                    <li class="${page_active }" tabindex="${index}"><a href="javascript:topage(${pageIndex }, ${pageModel.pageTotal })">${pageIndex }</a></li>
                </c:if>
            </c:forEach>
            <li class="next ${next_disabled }" tabindex="0"><a href="javascript:topage(${pageModel.pageNo+1 }, ${pageModel.pageTotal })">下一页</a></li>
        </ul>
        <span>向第</span>
        <input type="text" class="form-control" name="pageCurr" id="pageCurr" size="3">
        <span>页</span>
        <button type="button" onclick="jumppage(${pageModel.pageTotal})" class="btn btn-primary">跳转</button>
    </div>
